package com.cross.test;

import java.io.File;

import junit.framework.TestCase;

import com.cross.core.Reader;
import com.cross.core.SimpleTractor;
import com.cross.core.Writer;
import com.cross.plain.SimplePlainReader;
import com.cross.plain.SimplePlainWriter;
import com.cross.xml.SimpleXmlReader;
import com.cross.xml.SimpleXmlWriter;

public class SimpleXMLReaderToPlainWriterTestCase extends TestCase {

	public static void main(String[] args) {

		String xmlFile = "d:\\test\\data_DEPT4028808e229b75ab01229dde4b7a39a2_bis_theme_1288853068218.xml";
		String textFile = "d:\\test\\data_DEPT4028808e229b75ab01229dde4b7a39a2_bis_theme_1288853068218.txt";
		try {
			Reader reader = new SimpleXmlReader(new File(xmlFile));
			Writer writer = new SimplePlainWriter(reader.getHeader(), new File(textFile));
			new SimpleTractor(reader, writer).start();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String xmlFile1 = "d:\\test\\data_DEPT4028808e229b75ab01229dde4b7a39a2_bis_theme_1288853068218_1.xml";
		try {
			Reader reader = new SimplePlainReader(new File(textFile));
			Writer writer = new SimpleXmlWriter(reader.getHeader(), new File(xmlFile1));
			new SimpleTractor(reader, writer).start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
